﻿using System;
using System.Net;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ProxyFinder.Strategies;
using SoftwareApproach.TestingExtensions;

namespace ProxyFinder.Tests {
    [TestClass]
    public class IntegratedCredentialStrategyTests {
        [TestMethod]
        public void IntegratedCredentialStrategy_Create() {
            new IntegratedCredentialStrategy().ShouldNotBeNull();
        }

        [TestMethod]
        public void IntegratedCredentialStrategy_ShouldReturn_DefaultCredentialsWhenProxySystemProxyIsSet() {
            IntegratedCredentialStrategy strategy = new IntegratedCredentialStrategy();
            IWebProxy proxy = strategy.GetProxy(new Uri("http://www.google.com")).ShouldNotBeNull();
            proxy.Credentials.ShouldEqual(CredentialCache.DefaultCredentials);
        }
    }
}
